#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void* mal(char** p)
{
	*p = (char*)malloc(10);
	if (*p != NULL)
	{
		strcpy(*p, "hello ");
	}
}

int main()
{
	char* p1;
	char* p2;
	p2 = (char*)calloc(10,1);
	strcpy(p2, "world");
	mal(&p1);
	printf(p1);
	printf(p2);
	char* p0 = (char*)realloc(p2, 20);
	if (p0 != NULL)
	{
		p2 = p0;
		p0 = NULL;
	}
	strcpy(p2, "hello world");
	printf("\n");
	printf(p2);
	free(p2);
	p2 = NULL;
	free(p1);
	p1 = NULL;
	return 0;
}